/* 模板字符串 */

const name = 'Tony';
const age = 18;

// const string = `My name is ${name}, Age is ${age}`;
// console.log(string);

// 标签函数
// const str = console.log`My name is ${name}, Age is ${age}`;

// 标签函数作用是对字符串加工 返回一个新值。利用这个特性可以做语言切换(国际化)，模板引擎插件
const Tag = (string, ...rest) => {
  console.log(string);
  console.log(rest);
  return string.join();
};
const result = Tag`My name is ${name}, Age is ${age}`;
console.log(result);
